MarkLogic Server 11.0 Product Documentation
GET /v1/ext/{directories}

Summary

Retrieve a list of assets installed in the modules database associated with a REST API instance, such as a dependent library of an extension or transformation.

URL Parameters
format? The expected content type of the response, either xml or json. Overrides the Accept header.
Request Headers
Accept* The expected MIME type of the response, either application/xml, application/json, or text/xml. Ignored if the format parameter is present.
Response Headers
Content-type? The MIME type of the data in the response body, either application/xml or text/plain (JSON).

Response

Upon successful completion, MarkLogic Server responds with status code 200 (OK) and returns a list of installed assets in XML or JSON. See the examples, below. If no assets are found with the given directory path, MarkLogic Server returns status code 404 (Not Found).

Required Privileges

This operation requires the rest-admin role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-admin

http://marklogic.com/xdmp/privileges/rest-reader

http://marklogic.com/xdmp/privileges/rest-writer

Usage Notes

{directories} must be one or more database directory path steps. For example: /your/domain/. Use the same directory path as was used to install the asset with GET /v1/ext/{directories}/{asset}.

The directory path must end with "/".

For more details, see Managing Dependent Libraries and Other Assets in the REST Application Developer's Guide.

Example

$ curl --anyauth --user user:password -i -H "Accept: application/xml" -X GET  \
    'http://localhost:8000/v1/ext'

==> A list of all assets installed in the modules database under /ext/.
    MarkLogic Server responds with output similar to the following:

HTTP/1.1 200 OK
Server: MarkLogic
Content-Type: text/xml; charset=UTF-8
Content-Length: 119
Connection: Keep-Alive
Keep-Alive: timeout=5

<rapi:assets xmlns:rapi="http://marklogic.com/rest-api">
  <rapi:asset>/ext/replace/my-lib.xqy</rapi:asset>
</rapi:assets>
  

Example

$ curl --anyauth --user user:password -i -H "Accept: application/json" -X GET  \
    'http://localhost:8000/v1/ext'

==> A list of all assets installed in the modules database under /ext/,
    as JSON. MarkLogic Server responds with output similar to the following:

HTTP/1.1 200 OK
Server: MarkLogic
Content-Type: text/plain; charset=UTF-8
Content-Length: 48
Connection: Keep-Alive
Keep-Alive: timeout=5

{"assets":[
  {"asset":"/ext/replace/my-lib.xqy"}
]}
  

Example

curl --anyauth --user user:password -i -H "Accept: application/xml" -X GET  \
    'http://localhost:8000/v1/ext/example/'

==> A list of all assets installed in the /ext/example/ directory of the
    modules database. MarkLogic Server responds with output similar to the 
    following:

HTTP/1.1 200 OK
Server: MarkLogic
Content-Type: text/xml; charset=UTF-8
Content-Length: 119
Connection: Keep-Alive
Keep-Alive: timeout=5

<rapi:assets xmlns:rapi="http://marklogic.com/rest-api">
  <rapi:asset>/ext/example/my-lib.xqy</rapi:asset>
</rapi:assets>
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy